from ronglian_sms_sdk import SmsSDK
import json
accId = '2c94811c9035ff9f0190720f8c050b1a'
accToken = '9e821c2a3b2543989e4b4f9067ba8aae'
appId = '2c94811c9035ff9f0190720f8d7e0b21'

# 发短信
def send_message(mobile, sms_code):
    sdk = SmsSDK(accId, accToken, appId)
    tid = '1'
    mobile = mobile
    datas = (sms_code,)
    resp = sdk.sendMessage(tid, mobile, datas)
    # print(json.loads(resp))
    data = json.loads(resp) # json -> 对象
    print(data)
    if data['statusCode'] == '000000':
        return True
    return False
